package io.github.heollhai.common.utils;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.LocaleUtils;
import org.apache.commons.lang3.ObjectUtils;

import java.util.Arrays;
import java.util.List;

/**
 * @Author: lmf
 * @Create: 2024/6/7 11:09
 * Description: 数组工具类
 */
public class VerifyUtils {
    /**
     * 验证 值是为空
     */
    public static boolean isEmpty(Integer number) {
        return number == null || number.toString().isEmpty();
    }


    /**
     * 验证 值是为空
     */
    public static boolean isEmpty(String str) {
        return str == null || str.isEmpty();
    }

    /**
     * 验证 值不为空
     */
    public static boolean isNotEmpty(Integer number) {
        return !isEmpty(number);
    }

    /**
     * 验证 值不为空
     */
    public static boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }

    /**
     * 验证list集合为空
     */
    public static <T> boolean isEmpty(List<T> array) {
        return array == null || array.isEmpty();
    }
    /**
     * 验证list集合不为空
     */

    public static <T> boolean isNotEmpty(List<T> array) {
        return !isEmpty(array);
    }

    /**
     * 验证对象为空
     */
    public static <T> boolean isEmpty(T object) {
        return ObjectUtils.isEmpty(object);
    }
    /**
     * 验证对象不为空
     */
    public static <T> boolean isNotEmpty(T object) {
        return !isEmpty(object);
    }
}
